<template>
	<view class="contont">
		<nav-bar :title="title" :iconLeft="true" />
		<view class="content-bgc">
			<custom-list-de :record="detail_record" :columns="columns">
				<template #picture="{ record }">
					<image v-if="record.picture" :src="record.picture" class="preview-img"
						@click="previewImage(record.picture)" />
				</template>
				<template #marriage="{ record }">
					{{ record.marriage == 1 ? '未婚' : (record.marriage == 2 ? '已婚' : '离异') }}
				</template>
			</custom-list-de>
		</view>
	</view>
</template>
<script setup>
import { ref, reactive } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import conContractApi from '../../../api/contract/con_contract'

const detail_record = ref({})
const title = '合同审核详情';
onLoad(option => {
	get_detail(option.id);
})
const src = ref('')
const columns = [
	// { title: "照片", dataIndex: 'picture', scopedSlots: 'picture' },
	{ title: "编号", dataIndex: 'code' },
	{ title: "合同名称", dataIndex: 'name' },
	{ title: "合同类型", dataIndex: 'classify_name' },
	{ title: "甲方", dataIndex: 'party_a' },
	{ title: "签署日期", dataIndex: 'sign_date' },
	{ title: "生效日期", dataIndex: 'start_date' },
	{ title: "到期日期", dataIndex: 'end_date' },
	{ title: "备注", dataIndex: 'desc', note: true, },
]
function get_detail(id) {
	conContractApi.contract_detail(id).then(data => {
		detail_record.value = data
	})
}
const previewImage = (img) => {
	// uniapp 原生预览图片方法
	uni.previewImage({
		current: img.url || img,  // 当前显示图片
		urls: [img.url || img]    // 图片列表
	})
}

</script>

<style lang="scss"></style>